﻿<template>
    <div class="header_other">
      <div class="wrap_header_other clearfix">
          <div class="header_title_other">
            {{header_name}}
          </div>
          <img src="../../../static/img/new_style_go_back.png" class="btn" v-on:click="btn_cc" v-show="go_back_show"/>
          <img src="../../../static/img/bg_all.png" alt="" class="user_img" v-if="show_user_img_flag">
          <!--
          <img src="../../../static/img/Header_other/Header_other_cross.png" alt="" class="base_header_img header_other_cross f_R">
          <img src="../../../static/img/Header_other/Header_other_search.png" alt=""
          class="base_header_img header_other_search f_R" v-on:touchstart.self="show_select">
          <img src="../../../static/img/Header_other/Header_ohter_music.png"
          alt="" class="base_header_img header_other_music f_R" v-on:touchstart.self="show_music_player">
          -->
        <div v-html="card_div" v-if="!!card_div"></div>
      </div>
    </div>

</template>
<style  lang="scss" scoped>
  /*@import "../../../static/sass/thom_c_size.scss";*/
  @import "../sass/Header_name_img.scss";
</style>
<script>
  import {mapState, mapMutations, mapActions} from 'vuex';
  import Vue from "vue";
  import store from '../../vuex/store_index';
  import common from "../../common/common.js";
  import goto from "../../common/goto/goto.js";
  Vue.use(goto);
  export default {
    name: 'Header_other',
    data () {
      return {
        menu_list: this.$store.getters.get_footer_menu_list,
        sign_c: true,
        music_show: false,
        sex_select: false,
        seach_show: false,
        sex_select_flag: false,
        seach_show_flag:false,
        go_back_show:false,
      }
    },
    props :{'header_name':{ required: true},"go_back_flag":{ required: true},"card_div":{default:false},show_user_img_flag:{default:false}},
    computed: mapState([
      'footer_menu_list'
    ]),
    methods: {
      ...mapActions(['redirect']),
      btn_cc:function(){
        if(this.header_name === "写冒险卡"){
          this.$store.dispatch("thom_redirect",
            { name: "/user_index", router: this.$router });
            return;
        }
        if(this.header_name === "写限定卡"){
          this.$mui_goback();
          return
        }
        if(this.header_name === "编辑求学资料"){
          this.$emit("edit_goback");
          return;
        }
        common.go_back_none_btn();
      },
      show_music_player: function () {
        this.music_show = !this.music_show;
      },
      show_select: function (){
        this.seach_show = !this.seach_show
      },
      change_select_sex: function () {
        this.sex_select = !this.sex_select
      },
      beforeEnter_search: function () {
        if (this.music_show == true) {
          this.music_show = false;
        }
      },
      beforeEnter_music: function () {
        if (this.show_select == true) {
          this.show_select = false;
        }
      }
    },
    mounted(){
        console.log("go_back_flag",this.go_back_flag)
        console.log(this.header_name);
      if(this.header_name === "我的兑换"||this.go_back_flag==true){
            this.go_back_show = true;
      }
      //this.$store.getters.Get_Bot_C_obj
    }
  }
</script>
<!--inner style for thom template-->

